Optimal. Leaf size=107 \[ \frac {2 \left (a^2 C+3 a b B+b^2 C\right ) \sin (c+d x)}{3 d}+\frac {1}{2} x \left (2 a^2 B+2 a b C+b^2 B\right )+\frac {b (2 a C+3 b B) \sin (c+d x) \cos (c+d x)}{6 d}+\frac {C \sin (c+d x) (a+b \cos (c+d x))^2}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.16, antiderivative size = 107, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 38, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.079, Rules used = {3029, 2753, 2734} \[ \frac {2 \left (a^2 C+3 a b B+b^2 C\right ) \sin (c+d x)}{3 d}+\frac {1}{2} x \left (2 a^2 B+2 a b C+b^2 B\right )+\frac {b (2 a C+3 b B) \sin (c+d x) \cos (c+d x)}{6 d}+\frac {C \sin (c+d x) (a+b \cos (c+d x))^2}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2734
Rule 2753
Rule 3029
Rubi steps
\begin {align*} \int (a+b \cos (c+d x))^2 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx &=\int (a+b \cos (c+d x))^2 (B+C \cos (c+d x)) \, dx\\ &=\frac {C (a+b \cos (c+d x))^2 \sin (c+d x)}{3 d}+\frac {1}{3} \int (a+b \cos (c+d x)) (3 a B+2 b C+(3 b B+2 a C) \cos (c+d x)) \, dx\\ &=\frac {1}{2} \left (2 a^2 B+b^2 B+2 a b C\right ) x+\frac {2 \left (3 a b B+a^2 C+b^2 C\right ) \sin (c+d x)}{3 d}+\frac {b (3 b B+2 a C) \cos (c+d x) \sin (c+d x)}{6 d}+\frac {C (a+b \cos (c+d x))^2 \sin (c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.23, size = 90, normalized size = 0.84 \[ \frac {6 (c+d x) \left (2 a^2 B+2 a b C+b^2 B\right )+3 \left (4 a^2 C+8 a b B+3 b^2 C\right ) \sin (c+d x)+3 b (2 a C+b B) \sin (2 (c+d x))+b^2 C \sin (3 (c+d x))}{12 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.53, size = 85, normalized size = 0.79 \[ \frac {3 \, {\left (2 \, B a^{2} + 2 \, C a b + B b^{2}\right )} d x + {\left (2 \, C b^{2} \cos \left (d x + c\right )^{2} + 6 \, C a^{2} + 12 \, B a b + 4 \, C b^{2} + 3 \, {\left (2 \, C a b + B b^{2}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.48, size = 254, normalized size = 2.37 \[ \frac {3 \, {\left (2 \, B a^{2} + 2 \, C a b + B b^{2}\right )} {\left (d x + c\right )} + \frac {2 \, {\left (6 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, C a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, C b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 24 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 4 \, C b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 12 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, C a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, C b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.22, size = 114, normalized size = 1.07 \[ \frac {\frac {b^{2} C \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+b^{2} B \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+2 C a b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+2 B a b \sin \left (d x +c \right )+a^{2} C \sin \left (d x +c \right )+B \,a^{2} \left (d x +c \right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.32, size = 108, normalized size = 1.01 \[ \frac {12 \, {\left (d x + c\right )} B a^{2} + 6 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} C a b + 3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B b^{2} - 4 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} C b^{2} + 12 \, C a^{2} \sin \left (d x + c\right ) + 24 \, B a b \sin \left (d x + c\right )}{12 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.65, size = 115, normalized size = 1.07 \[ B\,a^2\,x+\frac {B\,b^2\,x}{2}+\frac {C\,a^2\,\sin \left (c+d\,x\right )}{d}+\frac {3\,C\,b^2\,\sin \left (c+d\,x\right )}{4\,d}+C\,a\,b\,x+\frac {B\,b^2\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {C\,b^2\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {2\,B\,a\,b\,\sin \left (c+d\,x\right )}{d}+\frac {C\,a\,b\,\sin \left (2\,c+2\,d\,x\right )}{2\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (B + C \cos {\left (c + d x \right )}\right ) \left (a + b \cos {\left (c + d x \right )}\right )^{2} \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________